<div class="operate2">
  <ul>
    <li onclick="window.location.href='{:U(MODULE_NAME.'/Menu/add')}'"><span class="icon-add01"></span>添加顶级菜单</li>
  </ul>
  <div class="clear"></div>
</div>
<table class="list">
  <thead>
    <tr>
      <th width="50%">名称</th>
      <th width="10%">显示</th>
      <th width="10%">排序</th>
      <th width="30%">操作</th>
    </tr>
  </thead>
  <tbody>
    <foreach name='list' item='list'>
      <tr>
        <td>{$list.name}</td>
        <td><if condition="$list['status'] eq 1">是<else/>否</if></td>
        <td>{$list.sort}</td>
        <td>
          <a href="{:U('Home/Menu/add',array('pid' =>$list['id']))}" class="format">添加子菜单</a>
          <a href="{:U('Home/Menu/edit',array('id' =>$list['id']))}" class="format">修改</a>
          <a href="javascript:;" class="disabled" onclick="toConfirm('{:U('Home/Menu/delete', array('id' =>$list['id']))}', '确实要删除吗？')">删除</a>
        </td>
      </tr>
      <foreach name="list.parent" item='parent'>
      <tr>
        <td class="aleft">&nbsp;&nbsp;├─{$parent.name}</td>
        <td><if condition="$parent['status'] eq 1">是<else/>否</if></td>
        <td>{$parent.sort}</td>
        <td>
          <a href="{:U('Home/Menu/add',array('pid' =>$parent['id']))}" class="format">添加子菜单</a>
          <a href="{:U('Home/Menu/edit',array('id' =>$parent['id']))}" class="format">修改</a>
          <a href="javascript:;" class="disabled" onclick="toConfirm('{:U('Home/Menu/delete', array('id' =>$parent['id']))}', '确实要删除吗？')">删除</a>
        </td>
      </tr>
      <foreach name="parent.child" item='child'>
      <tr>
        <td class="aleft">&nbsp;&nbsp;&nbsp;&nbsp;├─{$child.name}</td>
        <td><if condition="$child['status'] eq 1">是<else/>否</if></td>
        <td>{$child.sort}</td>
        <td>
          <a href="{:U('Home/Menu/edit',array('id' =>$child['id']))}" class="format">修改</a>
          <a href="javascript:;" class="disabled" onclick="toConfirm('{:U('Home/Menu/delete', array('id' =>$child['id']))}', '确实要删除吗？')">删除</a>
        </td>
      </tr>
      </foreach>
      </foreach>
    </foreach>
  </tbody>
</table>